package at.guigu.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/user5")
public class UserControllerFive {
    // 获取普通请求头
    @ResponseBody
    @RequestMapping("/quick1")
    public void save1(@RequestHeader(value = "User-Agent", required = false) String user_agent) throws Exception{
        System.out.println(user_agent);
    }
    // 获取特殊请求头：获取指定Cookie
    @ResponseBody
    @RequestMapping("/quick2")
    public void save2(@CookieValue(value = "JSESSIONID", required = false) String jessionid) throws Exception{
        System.out.println(jessionid);
    }
}
